1. Field of the Invention
This invention relates to multitasking computer systems having windowing programs controlling access to the frame buffer and, more particularly, to methods and apparatus for writing directly to the frame buffer in such a system.
2. History of the Prior Art
In its simplest form, a computer writes information from a single program to a frame buffer which stores the information so that it may be written to an output display. Usually, the display of this single program covers the entire output display. When it is desired to display more than one program at a time on an output display, each program is presented in a small portion of the display called a window (usually a rectangle). When a number of different programs are running on a computer system, a number of windows will appear on the screen of the output display. These windows may be moved about, may be changed in size (and sometimes in shape), and may often overlap one another. When one window overlaps another window in which a program is running, data must not be written to the portion of the window which is overlapped and in the background; that data must be clipped so that data in the foreground is not overwritten.
It is necessary, among other things, when running application programs in a plurality of windows to somehow set up the different windows into which each program is to fit, to direct the information from each application program to the correct window, and to take care of the overlapping of different windows so that the correct portions of each program are displayed.
If all of these tasks are done by the individual application programs, then there must be a great deal of checking among the programs to make sure that the different programs do not interfere with one another. This tends to slow the operation of the system and allows poorly designed software to distort the operation of the system. For this reason, more advanced computer systems have designed window management programs which take over the entire operation of writing to the frame buffer to control what is displayed.
A window management program controls the entire display, sets up the windows into which different programs may be written, controls the positioning of those windows, determines which information is displayed when windows overlap, and does all of the operations necessary to allow the simultaneous display of a number of application programs on a single output display device. When a program operating through a window management program desires to present information on the output display, it signals the window management program. The window management program assigns to it a particular portion of the display and sets up the window in which the program is to be displayed. Then, typically, as each pixel of information is furnished by the application program for presentation, the window management program determines the position on the screen at which that pixel is to appear, checks to see whether the pixel is obscured by some other window, and furnishes the results of the computation to the frame buffer for display on the output display. The window management program controls the positioning and repositioning of windows and any problems caused by overlapping. This guarantees that programs operate correctly in presenting their displays and relieves a programmer of the necessity of writing most of the procedures required for display purposes.
In such a system, only by going through the window management program can a program have its results displayed. Normally this is desirable because the window management program does all of the housekeeping which is necessary for a windows display and keeps the different programs from overwriting one another and otherwise interfering with each other on the display. However, such a method of presenting information has a significant overhead so that the frame buffer from which data is actually written to the display can be updated only about ten times a second. A computer system running such a windows management program does not update the frame buffer as rapidly as do individual programs in a system without a windows management program.
Many individual computer programs provide more satisfactory performance when the frame buffer is updated more rapidly than is possible using a windows management program. For example, live video such as television and animation programs require updating at a much faster rate than ten times a second. In general, thirty frames of video information are presented every second. If this information is to be presented in a window on an output display controlled by a window management program in which the frame buffer can only be updated ten times per second, the video picture which is presented will be distorted. It may appear to jump from one frame to the next, and frame tears may occur in which parts of different video frames appear on the display at once.
One way to present rapidly changing graphics information which is not distorted in a system using a window management program to control the display would be to bypass the window management program and write directly to the frame buffer. However, doing so creates all of the problems which a window management program was devised to solve. If an application program writes directly to the display, it may overwrite other programs or interfere in other ways with those other programs or may itself be overwritten by the window management program. Moreover, such a program must somehow overcome the delay caused by all of the cross-checking necessary to allow its existence with programs controlled by the window management program.